import React, { ReactNode } from 'react';
import { Entity } from './types';

import lemon_img from './images/柠檬.png';
import archive_img from './images/存档.png';
import tomato_img from './images/番茄.png';
import zoom_img from './images/观星.png';
import juice_img from './images/果汁.png';
import shield_img from './images/护甲.png';
import printer_img from './images/集体存档.png';
import beer_img from './images/啤酒.png';
import apple_img from './images/苹果.png';
import salad_img from './images/沙拉.png';
import shit_img from './images/屎.png';
import camera_img from './images/相机.png';
import pright_img from './images/右向.png';
import bomb_img from './images/炸弹.png';
import soccer_img from './images/足球.png';
import pleft_img from './images/左向.png';
import shoe_img from './images/鞋子.png';
import turtle_img from './images/乌龟.png';

// import './icons.css';
import { contain_key } from './utils';

const fruit_style = {
  height: "auto",
  width: "1.0em",
};

export const FRUITS: ReactNode[]= [
  tomato_img,
  lemon_img,
  apple_img,
].map(src => <img src={src} style={fruit_style} />);

export const shield_icon = <img src={shield_img} style={fruit_style} />;

export const skip_icon = <img src={shoe_img} style={fruit_style} />;

export const turtle_icon = <img src={turtle_img} style={fruit_style} />;

export function get_entity_icon(entity: Entity): ReactNode {
  if (typeof entity == "object") {
    return FRUITS[entity.fruit];
  }
  else if (entity == "shield") {
    return shield_icon;
  }
  else if (entity == "turtle") {
    return turtle_icon;
  }
  else {
    return skip_icon;
  }
}